<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<title>查询配送企业列表</title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>配送企业目录查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
			<li class="active"><a href="#">目录管理</a></li>
            <li class="active"><a href="#">配送企业目录</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class="box box-success">
            <div class="box-body">
                <div class="form-inline">
                    <div class="form-group form-group-xs">
                        <label>所属项目：</label>
                        <select class="form-control"  id="projId" >
                        	<option selected="selected" value="">请选择</option>
                        	 <c:forEach items="${projList}" var="pro">
            					<option  value="${pro.projId}">${pro.name}</option>
        					 </c:forEach>
                        	
                        </select>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">企业名称：</label>
                        <input class="form-control" type="text" id="compName" placeholder="企业名称" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">企业编码：</label>
                        <input class="form-control" type="text" id="compCode" placeholder="企业编码" />
                    </div>
                    <button type="button" onclick="likeQuery();" class="btn btn-success btn-sm">查询</button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
		
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
        $(function () {
            $("#gridlist").jqGrid({
                url: "getDataList.html",
                mtype: "GET",
                datatype: "json",
                autowidth: true,
                height: 270,
                colNames: ['采购项目配送企业关系id','企业编码', '企业名称', '组织机构代码', '所属集团', '注册地', '机构电话'],
                colModel: [
					{ name: 'projDelId',hidden:true, width: 140,align:"center"},
                    { name: 'compCode', width: 140,align:"center",
					     formatter:function(val, opts,rowdata) {
								var str = "<a href=\"javascript:detail('"+ rowdata.compCode+ "');\">"+rowdata.compCode+"</a>";
								return str;
			            	}
						 },
                    { name: 'compName', width: 190,align:"left" },
                    { name: 'orgCode', width: 120,align:"center" },
                    { name: 'compGroupName', width: 120,align:"center"},
                    { name: 'arFullName',width: 80,align:"center" },
                    { name: 'compPhone',width: 80,align:"center"},
                    
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "配送企业列表",
                jsonReader: {
                    repeatitems: false,
                    id: "ids"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
     	
     	function likeQuery() {
			var projId = $("#projId").val();
			var compName = $("#compName").val();
			var compCode = $("#compCode").val();
			$("#gridlist").jqGrid('setGridParam',{
								url : "${pageContext.request.contextPath}/proBaseProduce/getDataList.html",
				       	    	datatype:'json',
				       	    	mtype: "POST",
				                postData:{
				                	"projId":projId,
				                	"compName":compName,
				                	"compCode":compCode
				                	},
				                page : 1

			
			}).trigger("reloadGrid");
		}
     	
     	
    	function detail(compCode){
    		$.HN.dialog.opendialog(compCode,"配送企业详情","${ctx}/stdCompinfo/toStdCompinfoDetailJsp.html?compCodeDetail="+compCode,"800px","400px","function operResult(val){return operResult;}");
		}
    </script>
</body>
</html>